using System;

namespace Runtime.DesignPattern
{
    public class MediatorMessage : IMediatorMessage
    {
        public string MessageType { get; }
        public object Data { get; }
        public string TargetComponentId { get; }

        public MediatorMessage(string messageType, object data, string targetComponentId = null)
        {
            if (string.IsNullOrEmpty(messageType))
                throw new ArgumentException("Message type cannot be null or empty", nameof(messageType));

            MessageType = messageType;
            Data = data;
            TargetComponentId = targetComponentId;
        }
    }
}